﻿namespace DAQ.PROTOCOL
{
    using DAQ.Common;
    public class BAUDRATE_SET
    {
        /// <summary>
        /// 设置波特率
        /// </summary>
        /// <param name="Addr">站址</param>
        /// <param name="baud">波特率:03 57600 04 115200</param>
        /// <returns></returns>
        public static byte[] GetSendBytes(byte Addr,byte baud)
        {
            return BasicUtil.AppendChecksum(Addr, 0x38,baud,0x00);
        }
        public static int GetResult(byte ret)
        {
            if (ret == 0xFB)// communication OK
            {
                return 0;
            }

            else if (ret == 0xFA)//communication FAIL
            {
                return 1;
            }
            else //EXCEPTION
            {
                return -1;
            }
        }
    }
}
    

    


